from llama_index.llms.openai import OpenAI
import time
import os
from llama_index.core.llms import ChatMessage, TextBlock, ImageBlock

llm = OpenAI(model="gpt-4o")

messages = [
    ChatMessage(
        role="user",
        blocks=[ImageBlock(path="cat.jpg"), TextBlock(text="描述一下这张图片的内容")],
    ),
]
chat_response = llm.chat(messages)
print(chat_response.message.content)
